<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
   <title>Tables</title>

        <!-- Bootstrap -->
        <link href="<%=basePath%>bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="<%=basePath%>bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
        <link href="<%=basePath%>assets/styles.css" rel="stylesheet" media="screen">
        <link href="<%=basePath%>assets/DT_bootstrap.css" rel="stylesheet" media="screen">
        <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="vendors/flot/excanvas.min.js"></script><![endif]-->
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <script src="<%=basePath%>vendors/modernizr-2.6.2-respond-1.1.0.min.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
#www{
  width:450px;
    height: 150px;
     background-color: #fff;
     z-index:99999;
     position:fixed;
    display:none;
     left:494px;
   border: 1px solid gainsboro;
     
}

</style>


  </head>
  
  <body>
<%
    if(request.getSession().getAttribute("acc") == null) {
        response.sendRedirect("../emp/adminLogin");
    }
%>
     <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                     <span class="icon-bar"></span>
                    </a>
                   <a class="brand">麦包郎后台管理系统</a>

                    <!--/.nav-collapse -->
                </div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span3" id="sidebar">
					<ul class="nav nav-list bs-docs-sidenav nav-collapse collapse">
						<li  class="active">
							<a href="<%=basePath%>emp/getAll"><i class="icon-chevron-right"></i> 店铺管理</a>
						</li>
					
						<li>
							<a href="<%=basePath%>shop/today"><i class="icon-chevron-right"></i>今日订单 </a>
						</li>

						<li>
							<a href="<%=basePath%>ord/selectli"><i class="icon-chevron-right"></i> 历史订单</a>
						</li>

						
						<li>
							<a href="<%=basePath%>commodity/tong"><i class="icon-chevron-right"></i>食材管理</a>
						</li>
						<li>
							<a href="<%=basePath%>ord/caiwu"><i class="icon-chevron-right"></i>财务管理</a>
						</li>

					</ul>
                </div>
                <!--/span-->
                <div class="span9" id="content">



                     <div class="row-fluid">
                        <!-- block -->
                        <div class="block">
                            <div class="navbar navbar-inner block-header">
                                <div class="muted pull-left">店铺</div>
                            </div>
                            <div class="block-content collapse in">
                                <div class="span12" style={position:relative;}>
                                    
  									<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example">
										<thead>
											<tr>
												<th>联系电话</th>
												<th>店名</th>
												<th>密码</th>
												<th>审核</th>
												<th>修改店名</th>
												<!-- <th>操作</th> -->
											</tr>
										</thead>
										<tbody>
										<c:forEach items="${list}" var="bao">
											<tr class="odd gradeX">
												<td>${bao.account}</td>
												<c:if test="${bao.isTong==0}">
													<td style="color: red;">${bao.name}</td>
												</c:if>
												<c:if test="${bao.isTong==1}">
												<td>${bao.name}</td>
												</c:if>
												<c:if test="${bao.isTong==3}">
													<td style="color: #ccc;">${bao.name}</td>
												</c:if>
												<td>${bao.pwd}</td>
												<td class="center"> <c:if test="${bao.isTong==0}"><button  onclick="javascript:return tel(${bao.id});"  class="btn btn-info">通过</button></c:if><c:if test="${bao.isTong==1}">已通过</c:if>&nbsp;&nbsp;<c:if test="${bao.isTong==1}"><button  onclick="javascript:return del(${bao.id});"  class="btn btn-info">拒绝</button></c:if><c:if test="${bao.isTong==0}">未审核或已拒绝</c:if><c:if test="${bao.isTong==3}">已关店</c:if></td>
												<%-- <td class="center"><button  onclick="javascript:return delet(${bao.id});"  class="btn btn-info">删除</button></td> --%>
												<td ><a onclick="xiu(${bao.id})">修改</a></td>
											</tr>
										</c:forEach>

										</tbody>
									</table>
                                </div>
                            </div>
                        </div>
                        <!-- /block -->
                    </div>

                </div>
            </div>
            <hr>

        </div>
        

<!--修改货物开始-->
<div style=" display: none;
            z-index:999999;
            position: absolute;
            top: 25px;" id="rrr1" class="row-fluid">

    <div class="block">
        <div class="navbar navbar-inner block-header">
            <div class="muted pull-left">修改货物</div>
        </div>
        <div class="block-content collapse in">
            <div class="span12">
                <form class="form-horizontal"   method="post" action="commodity/saveAndUpdate" enctype="multipart/form-data">
                    <fieldset>
                        <legend>修改店铺</legend>
                   
                        <div class="control-group">
                            <label class="control-label" for="typeahead">店铺名称 </label>
                            <div class="controls">
                                <input type="text" name="name" class="span6" id="typeahead4"  data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
								<input id="id1" type="hidden" value="0" name="id"/>
                            </div>
                        </div>
                     
                        <div class="form-actions">
                            <button type="submit" class="btn btn-primary">确认</button>
                            <button id="quxiao1" type="reset" class="btn">取消</button>
                        </div>
                    </fieldset>
                </form>

            </div>
        </div>
    </div>

</div>
<!--修改货物结束-->
        
        
        
        
        
        
        
        
        
        <!--/.fluid-container-->

        <script src="<%=basePath%>vendors/jquery-1.9.1.js"></script>
        <script src="<%=basePath%>bootstrap/js/bootstrap.min.js"></script>
        <script src="<%=basePath%>vendors/datatables/js/jquery.dataTables.min.js"></script>


        <script src="<%=basePath%>assets/scripts.js"></script>
        <script src="<%=basePath%>assets/DT_bootstrap.js"></script>
        <script>
        function update(id){
            rrr1.style.display = "block";
            	 $.ajax({
                     type: "GET",
                     url: "commodity/getById",
                     data: {id:id},
                     dataType: "json",
                     success: function(data){
                        //var json=eval("("+data+")");
                        //alert(data.id); 
                        $("#typeahead4").val(data.name);
                        $("#id1").val(data.id);
                        $("#typeahead5").val(data.price);
                        $("#typeahead6").val(data.weight);
                        $("#typeahead7").val(data.danwei);
                 	 }
                 });
            }
        
        
        function xiu(id){
        	var age = prompt("请输入你要修改的店铺名:","例如：恒之诚包子店");
        	if (age!= null){
            	//alert(age);
        		window.location.href='emp/xiugaidianming?id='+id+'&name='+age;
        	}else{
        		alert("你按了[取消]按钮");
        	}
        }
        
        
        
        
        
        
        var q = document.getElementsByClassName("qqq");
//      console.log(q)
      for(var i=0;i<q.length;i++){

        q[i].onclick = function () {
            www.style.display = "block"
        }
      }
     
            function del(id) {
                var msg = "您真的确定要拒绝吗？\n\n请确认！";
                if (confirm(msg)==true){
                	window.location.href='emp/editState?state=0&id='+id;
                    return true;
                }else{
                    return false;
                }
            };
            function tel(id) {
              window.location.href='emp/editState?state=1&id='+id;
            };
			
			function delet(id){
				var msg = "您真的确定要删除吗？\n\n请确认！";
                if (confirm(msg)==true){
                	window.location.href='emp/deleteEmp?role=3&id='+id;
                    return true;
                }else{
                    return false;
                }
			}
        </script>
  </body>
</html>
